package com.esunrising.esungsc.controller;

import com.esunrising.esungsc.entity.TApiKmtx;
import com.esunrising.esungsc.service.KMSXService;
import com.esunrising.esungsc.service.KMTXService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/api/v1/bfChartOfAccount")
@Api(value = "/api/v1/bfChartOfAccount", tags = {"科目体系模块处理接口"})
@Slf4j
public class KMTXController {

    @Resource
    private KMTXService kmtxService;

    @Resource
    private KMSXService kmsxService;

    @GetMapping("/bfcoaResult")
    public Object getKMTXResult() {
        String year = "2024";

        //取科目体系的数据，将数据解析，存到list集合里
        List<TApiKmtx> kmtxList = kmtxService.getKMTXResult(year);

        System.out.println("~~~~"+kmtxList);
        //将数据保存到数据库中
//        kmtxService.saveKmtx(kmtxList);

        return null;
    }
}
